/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.purpose.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.koron.purpose.domain.ScoreAssessment;

public interface ScoreAssessmentMapper {
	@Delete("delete from score_assessment where assessment_id=#{id}")
	int delete(@Param("id") String assessmentId);
	
	@Insert("insert into score_assessment(id,serial,score_project,note,staff_code,staff_name,score_date,score,assessment_id) values"
			+ "(#{id},#{serial},#{scoreProject},#{note},#{staffCode},#{staffName},#{scoreDate},#{score},#{assessmentId})")
	int insert(ScoreAssessment bean);
	
	@Select("select * from score_assessment where assessment_id=#{id} and serial <=#{serial} order by serial")
	List<ScoreAssessment> queryList(@Param("id") String assessmentId,@Param("serial") Integer serial);
}
